/*
 * @Author: upp24 1246815351@qq.com
 * @Date: 2023-07-07 11:41:54
 * @LastEditors: upp24 1246815351@qq.com
 * @LastEditTime: 2023-09-07 11:45:50
 * @FilePath: /pure-admin-thin-i18n/src/api/home.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    img(img: any): string;
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};
/** 城市统计*/
export const homeCity = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/cityall"), {
    data
  });
};
/**每日订单统计 */
export const homeOrder = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/cityday"), {
    data
  });
};
/**每周订单统计 */
export const homeWeek = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/cityweek"), {
    data
  });
};
/**用户统计 */
export const homeUser = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/user"), {
    data
  });
};
/**订单统计 */
export const homeRatio = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/ratio"), {
    data
  });
};
/**时间线 */
export const homeMonth = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/month"), {
    data
  });
};

/**用户占比统计 */
export const homeProportion = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/area"), {
    data
  });
};

/**省订单排行 */
export const homeProvince = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("home/provinceall"), {
    data
  });
};
